package olddriver.wyf.com.olddriver

import android.app.Application
import com.zhy.http.okhttp.OkHttpUtils
import com.zhy.http.okhttp.log.LoggerInterceptor
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit

/**
 * Created by Administrator on 2017/8/24.
 */
class App : Application() {

    override fun onCreate() {
        super.onCreate()

        initOkHttp()

    }

    private fun initOkHttp() {

        var okHttp = OkHttpClient
                .Builder()
                .connectTimeout(5000L,TimeUnit.MILLISECONDS)
                .readTimeout(5000L,TimeUnit.MILLISECONDS)
                .addInterceptor(LoggerInterceptor("OKHTTP"))
                .build()

        OkHttpUtils.initClient(okHttp)
    }
}